﻿<%@ Page Language="C#" MasterPageFile="~/Admin.master" AutoEventWireup="true" CodeFile="TopicPosts.aspx.cs" Inherits="Topics_TopicPosts" %>
<asp:Content id="contentHead" ContentPlaceHolderID="phHead" runat="server">
    <script type="text/javascript">
        function addPostClosed(oWnd) {
            if (oWnd && oWnd.argument && oWnd.argument.saved) {
                __doPostBack(lnkAddUniqueId, "");
            }
        }
    </script>
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="phMain" Runat="Server">
    <asp:Panel CssClass="DirectionText" runat="server">
        <p>The posts currrently included in this topic. Remember to publish any changes you make to the pending posts.</p>
        <%# string.Format("<p>{0}</p>", CurrentGroup.Notes)%>
    </asp:Panel>
    <div class="itemPanel">
        <telerik:RadTabStrip ID="tabSiteVersions" Skin="ACMSTab" EnableEmbeddedBaseStylesheet="true" EnableEmbeddedSkins="false" runat="server" AutoPostBack="True" ontabclick="tabSiteVersions_TabClick">
        </telerik:RadTabStrip>
        <div class="tabPage">
            <div class="actionButtons clearfix">
                <div class="floatRight">
                    <acms:ActionButton ID="lnkAdd" Text="Add Post" OnClick="lnkAdd_Click" Icon="AddChild" runat="server" />
                </div>
            </div>
            <telerik:RadGrid ID="gridPosts" DataSourceID="dsPosts" 
                AutoGenerateColumns="false" AllowPaging="true" runat="server" 
                onitemcommand="gridPosts_ItemCommand">
                <MasterTableView DataKeyNames="Id,ConcurencyId">
                    <Columns>
                        <telerik:GridBoundColumn DataField="ParentPath" HeaderText="Parent Path" />
                        <acms:RadGridHyperLinkColumn DataTextField="DisplayName" DataNavigateUrlFormatString="~/Posts/Details.aspx?Id={0}&amp;SV={1:yyyy/MM/dd+HH\%3amm\%3add}" DataNavigateUrlFields="Id,SiteVersion" HeaderText="Display Name" />
                        <telerik:GridBoundColumn DataField="Url" HeaderText="Url" />
                        <telerik:GridButtonColumn Text="Remove" ConfirmTitle="Confirm Remove" ConfirmText="Are you sure you want to remove this post from this topic?" ConfirmDialogType="RadWindow" CommandName="Remove"/>
                    </Columns>
                </MasterTableView>
            </telerik:RadGrid>
        </div>
    </div>
    <telerik:RadWindowManager ID="winManager" runat="server">
        <Windows>
            <telerik:RadWindow ID="winAdd" Title="Select Post To Add" Behaviors="None" Width="800" Height="600" Modal="true" ShowContentDuringLoad="false" OpenerElementID='<%#lnkAdd.ClientID %>' OnClientClose="addPostClosed" runat="server">
            </telerik:RadWindow>
        </Windows>
    </telerik:RadWindowManager>
    <telerik:RadAjaxManager ID="ajaxManager" DefaultLoadingPanelID="loading" EnableAJAX="true" runat="server">
        <AjaxSettings>
            <telerik:AjaxSetting AjaxControlID="lnkAdd">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="gridPosts" />
                </UpdatedControls>
            </telerik:AjaxSetting>
            <telerik:AjaxSetting AjaxControlID="gridPosts">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="gridPosts" />
                </UpdatedControls>
            </telerik:AjaxSetting>
            <telerik:AjaxSetting AjaxControlID="tabSiteVersions">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="gridPosts" />
                    <telerik:AjaxUpdatedControl ControlID="tabSiteVersions" />
                    <telerik:AjaxUpdatedControl ControlID="btnAdd" />
                    <telerik:AjaxUpdatedControl ControlID="winManager" />
                </UpdatedControls>
            </telerik:AjaxSetting>
        </AjaxSettings>
    </telerik:RadAjaxManager>
     <telerik:RadAjaxLoadingPanel ID="loading" InitialDelayTime="0" MinDisplayTime="2" Transparency="50" BackColor="DimGray" runat="server" Height="100%"
        Width="100%">
        <img alt="Loading..." src="../icons/loading1.gif" style="border: 0px;" />
    </telerik:RadAjaxLoadingPanel>
       <acms:PostDataSource ID="dsPosts" runat="server" 
        onselectdata="dsPosts_SelectData"></acms:PostDataSource>
</asp:Content>

